Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Using multiple windows
As you’ve already learned, there is no
DEFINE WINDOWstatement in Progress. Any windows you build for your application are dynamic windows. This section summarizes some of the window handles and attributes that can be useful to you in designing an application with multiple windows.You create a window with the
CREATE WINDOWstatement, which has the same syntax as every otherCREATEstatement you’ve seen.Window system handles
The simple examples in this book that don’t use a window you create (or that is created for you in code the AppBuilder generates) use the default window that is part of every session. This has a system handle called
DEFAULT-WINDOW. This handle is not something you would ordinarily use in a real application.You’ve seen the
CURRENT-WINDOWsystem handle, which holds the handle of the window used by default for parenting frames, dialog boxes, and message alert boxes. TheCURRENT-WINDOWattribute of a procedure overridesCURRENT-WINDOWfor the context of that procedure only, without changing the value of the session-wide system handle. The statements in the standard AppBuilder window template that set bothCURRENT-WINDOWand theCURRENT-WINDOWprocedure attribute to the procedure’s window provide a good default for parenting of objects created and used in that procedure.Another useful system handle is
ACTIVE-WINDOW, which holds the handle of the window that has received the most recent input focus in the application. This handle can help you assure that a dialog box or message alert box appears parented to the window where the user is currently working, even if it is not the current window of the procedure that executes the code to display the dialog box or message.Useful window attributes, methods, and events
Table 18–1 describes the numerous attributes, methods, and events that you can use to control the appearance and behavior of windows in your application.
WINDOW-CLOSE event example
The simplest example of an action on the
WINDOW-CLOSEevent is this:
If the
WAIT-FORstatement is the last executable statement in a nonpersistent procedure, the event satisfies theWAIT-FORand the procedure terminates.The AppBuilder window template uses indirection to direct the
WINDOW-CLOSEevent for the window to the procedure itself, using this standardON WINDOW-CLOSEtrigger:
You’ve already seen the rest of the steps in this sequence, with the
CLOSEevent on the procedure runningdisable_UIand deleting the procedure itself.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |